AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include('shared.lua')

local function ArmorPiercerStructure(ent, inflictor, attacker, amount, dmginfo)
	if (ent.Structure && attacker:GetNWBool("Armor Piercerd")) then
		dmginfo:ScaleDamage(1.625)
	end
end
hook.Add("EntityTakeDamage", "ArmorPiercerEnt", ArmorPiercerStructure)

local function ArmorPiercerPlayer(ply, hitgroup, dmginfo)
	local attacker = dmginfo:GetAttacker()
	local plarmor = ply:Armor()
	if (plarmor > 0 && attacker != ply && attacker:GetNWBool("Armor Piercerd")) then
		local armordamage = dmginfo:GetDamage()*.25
		if armordamage >= plarmor then
			ply:SetArmor(0)
		else
			ply:SetArmor(plarmor-armordamage)
		end
	end
end
hook.Add("ScalePlayerDamage", "ArmorPiercerPlayer", ArmorPiercerPlayer)